<template>
      <tr>
        <td>合计:</td>
        <td colspan="5">{{ sumFn }}</td>
      </tr>
</template>

<script>
export default {
  props: ["sum"],
  computed:{
    sumFn() {
      return this.sum.filter(item=> item.checked === true)
      .reduce((sum, item) => {
          return sum + item.price * item.num;
      },0);
    },
  }
};
</script>

<style>
</style>